class Stack:
    def __init__(self):
        self.items = []

    def push(self, item):
        self.items.append(item)

    def pop(self):
        if not self.is_empty():
            return self.items.pop()
        return None

    def is_empty(self):
        return len(self.items) == 0

    def peek(self):
        if not self.is_empty():
            return self.items[-1]
        return None

def remove_consecutive_duplicates(s):
    """栈实现连续重复字符去重"""
    stack = Stack()
    for char in s:
        # 若栈顶与当前字符相同，弹出栈顶（去重）
        if not stack.is_empty() and stack.peek() == char:
            stack.pop()
        else:
            stack.push(char)
    # 拼接栈中剩余字符
    result = ""
    while not stack.is_empty():
        result = stack.pop() + result
    return result

# 测试
if __name__ == "__main__":
    print(remove_consecutive_duplicates("aabbcc"))  # 输出: abc
    print(remove_consecutive_duplicates("aaaabbb")) # 输出: ab
    print(remove_consecutive_duplicates("abc"))     # 输出: abc